<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCustomFormFieldsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('custom_form_fields', function (Blueprint $table) {
            $table->integer('id')->unique()->comment('id');
            $table->integer('form_id')->default(0)->comment('视图ID');
            $table->integer('field_id')->default(0)->comment('字段ID');
            $table->tinyInteger('sort')->default(0)->comment('排序');
            $table->tinyInteger('status_type_id')->default(0)->comment('状态');

            $table->tinyInteger('is_tenant_update')->default(0)->comment('租户是否改动');
            $table->integer('created_id')->default(0)->comment('创建人');
            $table->integer('updated_id')->default(0)->comment('修改人');
            $table->integer('created_at')->default(0)->comment('创建时间');
            $table->integer('updated_at')->default(0)->comment('修改时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('custom_form_fields');
    }
}
